<?php
$strCookieKey	= 'bcmt' . $intBlogId;
$intPage		= isset($_COOKIE[$strCookieKey]) ? $_COOKIE[$strCookieKey] : $objRequest->getParam('page',1);
$intLimit		= COMMENT_LIMIT;
$intOff			= (($intPage-1) * $intLimit);
$intTotal		= 0;
$strUrl			= HOST_VFRIEND . 'comment/blog?blogid=' . $intBlogId . '&';
$intTotal	 	= $objBlog->getCmtTotal($intBlogId);
if($intTotal > $intLimit && !isset($_COOKIE[$strCookieKey])) {
	$intPage 	= ceil($intTotal/$intLimit);
	$intOff 	= ($intPage - 1) * $intLimit;	
}
if($intOff >= $intTotal && $intOff) $intOff = $intTotal - $intLimit;
$arrComment		= $objBlog->getCmtList($intBlogId, $intOff, $intLimit);
$this->view->arrComment	= $arrComment;
$this->view->intTotal	= $intTotal;
$this->view->intOffset	= $intOff;
$this->view->intLimit	= $intLimit;
$this->view->intPage	= $intPage;
$this->view->strUrl		= $strUrl;
?>